﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;
using DAO;

namespace WindowsFormsApplication1
{
    public partial class frmQuyDinhKhachHang : Form
    {
        public frmQuyDinhKhachHang()
        {
            InitializeComponent();
        }

        private void btThoat_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn thoát không", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                this.Close();
            }
        }
        void loadDSKH()
        {
            int stt = 1;
            List<KhachHangDTO> lst = KhachHangDAO.LayDanhSachKhachHang();
            for (int i = 0; i < lst.Count; i++)
            {
                string[] dong = new string[] { stt++.ToString(), lst[i].TenKhachHang, lst[i].CMND.ToString(), lst[i].DiaChi, lst[i].TenLKH1};
                dtgvDSKhachHang.Rows.Add(dong);
            }
            //dtgvDSKhachHang.DataSource = KhachHangDAO.LayDanhSachKhachHang(); 
        }
        private void frmQuyDinhKhachHang_Load(object sender, EventArgs e)
        {
            loadDSKH();
        }
    }
}
